/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.wpi.first.wpilibj.team1662.commands.auto;

import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.team1662.RobotMap;
import edu.wpi.first.wpilibj.team1662.commands.CommandBase;
import edu.wpi.first.wpilibj.team1662.commands.Drive;

/**
 *
 * @author programmer
 */
public class RevShooter extends CommandBase{
    
    public RevShooter(){
        requires(launcher);
        requires(drivetrain);
        
    }
    
    protected void initialize() {
        System.out.println("On RevShooter");
        launcher.lock();
        drivetrain.shooter(0);
        setTimeout(3);
    }

    protected void execute() {
        launcher.lock();
        if(RobotMap.limitSwitch1.get()==false)
            drivetrain.shooter(0);
        else if(RobotMap.limitSwitch1.get() == true)
            drivetrain.shooter(-.9);
    }

    protected boolean isFinished() {
        return isTimedOut();
    }

    protected void end() {
        drivetrain.shooter(0);
        System.out.println("Done with RevShooter");       
    }

    protected void interrupted() {
        drivetrain.shooter(0);
    }
    
}
